<div>

	<a href="/posts/agregar/"><button class="btn primary">Agregar</button></a>
	
	<table>
		<tr>
			<td>Id</td>
			<td>Titulo</td>
			<td>Fecha</td>
			<td>&nbsp;</td>
			<td>&nbsp;</td>
		</tr>
		
		<?php if( count( $this->paginator )) :?>
		
		<?php foreach( $this->paginator as $post) :?>
		
		<tr>
			<td><?php echo $post->id;?></td>
			<td><?php echo $post->title;?></td>
			<td><?php echo $post->created_at;?></td>
			<td align="center"><a href="/posts/update/id/<?php echo $post->id ?>"><button class="btn success">Editar</button></a></td>
			<td align="center"><a href="/posts/delete/id/<?php echo $post->id ?>"><button class="btn danger">Borrar</button></a></td>
		</tr>
		
	
		<?php endforeach;?>
		<?php else : ?>
		<tr>
			<td colspan="3">No hay datos</td>
		</tr>
		
		<?php endif;?>
		
		
		<?php if( count( $this->paginator )):?>
		    <?php echo $this->paginator;?>
		<?php endif;?>
	</table>
</div>